Online documentation - WebsydianExpress v3.5 |
Abstract.HTMLDropDownGeneratorForProcess
Inherit from this function if you want to have a drop down box, with dynamically loaded data on you page.
The normal usage is when you have an entity with a limited number of entries - and want to select one of these entries as part of the input for an event on a webpage.
Dynamically loaded drop downs are used in several of the business processes used by the administration interface of Websydian Express - for example on the user maintenance pages, where you can select a folder list that you want to assign to the user - this drop down is loaded based on the entries in the folder list table for the site.
Often you will use the same drop down box on many pages. This means that is a good idea to let HTMLDropDownGeneratorForProcess inherit from PageGeneratorNoPresentation as these pages normally will be used by several business processes that have more than one presentation. Inheriting from PageGeneratorNoPresentaion means that you do not have to create new templates for the drop down box for each presentation.
When the HTMLDropDownGenerator calls the BlockFetch function, it will call with blank values for the fields in the Position variable. This ensures that all records in the table is shown in the drop down box. However, this is a problem if the BlockFetch function restricts on one or more of the fields in the Position variable. In this case, the BlockFetch will get a blank value for the restrict field - and the BlockFetch will not return any records.
To ensure that all restrict fields are transferred unaltered to the BlockFetch, you must add them to the local variable Restrict. The values of these fields will be set to the values of the fields in the Position input variable and they will be used as parameters for the call to the BlockFetch function.
This behavior is specific to the WebsydianExpress implementation of the drop down functionality.
In versions prior to WebsydianExpress version 3.5, there is an error in the pattern, which means that the mapping of the field in the Restrict variable wasn't used as parameters for the call to the BlockFetch - in these versions, you must map the parameters manually.